package require tcltest
package require Expect

namespace eval ::simulator::test {
  namespace import ::tcltest::*

  variable BEFORE {
    catch { unset result }
    set env(SIMULATOR_SCENARIOS_DIR) "./test/fixtures/valid"
    set env(SIMULATOR_TF_DIR) "./test/fixtures/noop-tf-dir"
    set env(SIMULATOR_CLI_TEST_OUTPUT) "./test/test.debug"
  }

  variable AFTER {
    unset env(SIMULATOR_SCENARIOS_DIR)
    unset env(SIMULATOR_TF_DIR)
    unset env(SIMULATOR_CLI_TEST_OUTPUT)
  }

  test scenario_list_prints_ok {
    Test: simulator scenario list
  } -body {
    spawn "simulator" "scenario" "list"
    expect "Scenario 1" { set result 1 } default { set result 0 }
  } -setup $BEFORE -cleanup $AFTER -result 1

  # test scenario_launch_prints_ok {
  #   Test: simulator scenario launch scenario_1
  # } -body {
  #   spawn "simulator" "scenario" "launch" "scenario_1"
  #   expect "Scenario 1" { set result 1 } default { set result 0 }
  # } -setup $BEFORE -cleanup $AFTER -result 1

  cleanupTests 1
}

# vim: ft=tcl
